import { environment } from './../environments/environment';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NZ_I18N } from 'ng-zorro-antd/i18n';
import { zh_CN } from 'ng-zorro-antd/i18n';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import {
  NzInputModule,
  NzListModule,
  NzButtonModule,
  NzSelectModule,
  NzGridModule,
  NzIconModule,
  NzTableModule,
  NzSpinModule
} from 'ng-zorro-antd';
import { API_SERVICE_ENDPOINT } from './services/api.service';

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    NzInputModule,
    NzListModule,
    NzButtonModule,
    NzSelectModule,
    NzGridModule, NzIconModule, NzTableModule, NzSpinModule
  ],
  providers: [{ provide: NZ_I18N, useValue: zh_CN }, { provide: API_SERVICE_ENDPOINT, useValue: environment.production ? '.' : undefined }],
  bootstrap: [AppComponent]
})
export class AppModule { }
